﻿using System;
using System.Collections.Generic;
using System.Threading;

namespace BaseFeatureDemo.Base.ThreadDemo.ThreadBase
{
    public class ListDemo2
    {
        private static int max = 1000;
        private static long _cout = 0;

        public static void Main1()
        {
            Thread t = new Thread(new ThreadStart(() =>
            {
                for (int i = 0; i < max; i++)
                {
                    _cout++;
                }
            }
                ));
            t.Start();
            for (int i = 0; i < max; i++)
            {
                _cout--;
            }
            t.Join();
            Console.WriteLine("{0}", _cout);
            Console.ReadKey();
        }
    }
}